import React, { Component } from 'react';
import * as common from 'common/common.js';
import { SearchBar } from 'antd-mobile';
import './search.less';

/**
 * 头部搜索
 */
class Search extends Component{

	render(){
		return(
			<div className="search">
				<div className="top">
					<div className="content">
						<SearchBar 
						 	placeholder="搜索商品" 
							cancelText={"关闭"} 
							onFocus={()=>common.gotoGoodsSearch({searchType: this.props.searchType, searchKeyword:this.props.searchKeyword})}
						/>
					</div>
					<div className="right" onClick={()=>common.gotoGoodsSearch({searchType: this.props.searchType, searchKeyword:this.props.searchKeyword})}>
						<span>搜索</span>
					</div>
				</div>
			</div>
		)
	}
}

export default Search;